def parse_time(time_str: str) -> float:
    if "ms" in time_str:
        time_str = time_str.replace(" ", "")
        splited = time_str.split("ms")
        ms = float(splited[0])
        splited = splited[1].split("µs")
        us = float(splited[0])
        splited = splited[1].split("ns")
        ns = float(splited[0])
        return ms * 10 ** -3 + us * 10 ** -6 + ns * 10 ** -9
    if ":" in time_str:
        time_str = time_str.replace(" ", "")
        time_str = time_str.split(":")[1]
        s = time_str.split(".")[0]
        rest = time_str[time_str.find(".")+1:].replace(".", "")
        return float(f"{s}.{rest}")
